package com.allwees.data.analysis.stat.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.allwees.bs.core.model.stat.EStatType;
import com.allwees.bs.core.modelbase.constant.EPlatform;
import com.allwees.data.analysis.stat.EStatMode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * Daily Stat
 *
 * @author yangylsky
 * @since 2020-04-16
 *
 */
@Data
@EqualsAndHashCode(callSuper=false)
@ToString
@Accessors(chain = true)
@TableName("stat_daily_stat")
public class DailyStatEntity extends BaseStatEntity {
	@Override
	protected EStatMode statMode() {
		return EStatMode.DAILY;
	}

    public static DailyStatEntity ofDefault(EStatType statType, Date date) {
    	DailyStatEntity dailyStat = new DailyStatEntity();
        dailyStat.setStatType(statType)
	        .setPlatform(EPlatform.H5)
	        .setDate(date)
	        .setValue(0.0)
	        .setUuid(dailyStat.uniqueId());
        return dailyStat;
    }
}
